<include file="Inc/in_head" />
<nav class="navbar navbar-default">
	<div class="container">
	    <div class="navbar-header"> 
	      <a class="navbar-brand" href="#">Jaguar后台管理系统</a>
	    </div>
		
	    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
	      <ul class="nav navbar-nav">
	        <li><a href="/Admin/User/index">用户管理<span class="sr-only">(current)</span></a></li>
	        <li class="active"><a href="/Admin/Active/index">活动管理</a></li>
	      </ul> 
	      <ul class="nav navbar-nav navbar-right">
	        <li><a href="#">退出</a></li>
	      </ul>
	    </div>
	</div>
</nav>

<div class="container">
<div class="panel panel-default">
  <div class="panel-body">
   <a class="btn btn-primary btn-xs pull-right" href="/index.php/Admin/Active/index"><span class="glyphicon glyphicon-arrow-left"></span> 返回活动列表</a>
   活动管理
  </div>
</div> 
  
	<form class="form-horizontal" enctype="multipart/form-data" method="POST" action="/index.php/Admin/Active/save">
	<if condition="$d.id gt 0"> <input type="hidden" id="id" name="id" value="{$d.id}"></if>
	 
	  <div class="form-group">
	    <label for="city" class="col-sm-1 control-label">所在城市</label>
	    <div class="col-sm-11">
	      <input type="text" class="form-control" id="city" name="city" placeholder="city" value="{$d.city}">
	    </div>
	  </div>
	  <div class="form-group">
	    <label for="image" class="col-sm-1 control-label">活动图片</label>
	    <div class="col-sm-11">
	      <input type="file" class="form-control" id="image" name="image" placeholder="image"  value="{$d.image}">
	    </div>
	  </div>
	  <div class="form-group">
	    <label for="map" class="col-sm-1 control-label">地图图片</label>
	    <div class="col-sm-11">
	      <input type="file" class="form-control" id="map" name="map" placeholder="map" value="{$d.map}">
	    </div>
	  </div>
	  <div class="form-group">
	    <label for="p_x" class="col-sm-1 control-label">标点</label>
	    <div class="col-sm-11">
	      <img id="map_bg" src="/Public/Home/image/info/map1.jpg" />
	    </div>
	  </div>
	  <div class="form-group">
	    <label for="p_x" class="col-sm-1 control-label">坐标X</label>
	    <div class="col-sm-5">
	      <input type="text" class="form-control" id="p_x" name="p_x" placeholder="p_x" value="{$d.p_x}">
	    </div>
	    <label for="p_y" class="col-sm-1 control-label">坐标Y</label>
	    <div class="col-sm-5">
	      <input type="text" class="form-control" id="p_y" name="p_y" placeholder="p_y" value="{$d.p_y}">
	    </div>
	  </div>
	  <div class="form-group">
	    <label for="starttime" class="col-sm-1 control-label">开始时间</label>
	    <div class="col-sm-5">
	      <input type="datetime" class="form-control" id="starttime" name="starttime" placeholder="starttime" value="{$d.starttime}">
	    </div>
	    <label for="endtime" class="col-sm-1 control-label">结束时间</label>
	    <div class="col-sm-5">
	      <input type="datetime" class="form-control" id="endtime" name="endtime" placeholder="endtime" value="{$d.endtime}">
	    </div>
	  </div>
	  <div class="form-group">
	    <div class="col-sm-offset-1 col-sm-11">
	      <button type="submit" class="btn btn-default">保 存</button>
	    </div>
	  </div>
	</form>
</div>
<style type="text/css">
#map_bg{ cursor:url('/Public/Home/image/PP.ico'),auto; }
</style>
<include file="Inc/in_foot" />

<script language="javascript">
$(function(){
	$('#map_bg').click(function(e){
		var P = $('#map_bg').offset();
		var S = { W:$('#map_bg').width() , H:$('#map_bg').height() } ; 
		var SC = { X:$('body').scrollLeft() , Y:$('body').scrollTop() } ; 
		var POINT = { x:(e.clientX-P.left+SC.X)*100/S.W,y:(e.clientY-P.top+SC.Y)*100/S.H };
		$('#p_x').val(parseInt(POINT.x));
		$('#p_y').val(parseInt(POINT.y));
	});
});
</script>
